﻿using System;
namespace ForumLibrary
{
    public abstract class IForumManager : MarshalByRefObject, IObservable
    {
        public abstract string addFriend(string friendAdding, string friendAdded);
        public abstract string addPost(string username, string forumName, string threadName, string header, string body);
        public abstract string addThread(string username, string forumName, string header, string body);
        public abstract string deletePost(string username, string forumName, string threadName, string postName);
        public abstract string editPost(string username, string forumName, string threadName, string postName, string newHeader, string newBody);
        public abstract string editThread(string username, string forumName, string threadName, string header, string body);
        public abstract string deleteThread(string username, string forumName, string threadName);
        public abstract string getForumsTopics();
        public abstract string getFriendslist(string username);
        public abstract string getPostsDetails(string forumName, string threadName);
        public abstract string getPostHeaders(string forumName, string threadName);
        public abstract string getThreadDetails(string forumName, string threadName);
        public abstract string getThreadOwner(string forumName, string threadName);
        public abstract string getThreadsHeaders(string forumName);
        public abstract string getPostDetails(string forumName, string threadName, string postName);
        public abstract string getUsersList();
        public abstract string login(string username, string password);
        public abstract string moderatorLogin(string username, string password);
        public abstract string logout(string username);
        public abstract string register(string firstName, string lastName, string username, string password, string email, string phone, bool isModerator);
        public abstract string removeFriend(string friendRemoving, string friendRemoved);
        public abstract string searchForNewFriend(string searchedUser);
        public abstract bool isPostOwnerOrModerator(String forumName, String threadName, String PostName, String username);
        public abstract bool checkModeratorPassword(String pass);
        public abstract void demo();
        public abstract void subscribe(IObserver observer, string username, bool loginState);
        public abstract void unsubscribe(string username);
        public abstract string getUserDetails(string username);
        public abstract string deletePost(string username, string forumName, string threadName, string postName, string body);

        /// <summary>
        /// Method to set that the remote object "IForumManager" would be
        /// available indefinitely and not disconnect after 5 minutes
        /// </summary>
        /// <returns>null to set indefinitely time window </returns>
        public override object InitializeLifetimeService()
        {
            //return base.InitializeLifetimeService();
            return null;
        }
    }
}
